<template>
  <div>
    <el-table
      :data="data"
      :border="true"
      :header-cell-class-name="$style.tableHeaderCell"
      v-loading="loading"
      tooltip-effect="dark"
      style="width: 100%"
      max-height="700"
      ref="storeTable"
    >
      <el-table-column type="index" align="center" fixed width="60" />
      <el-table-column align="center" min-width="250px" prop="goodsName" label="商品名称" fixed></el-table-column>
      <el-table-column align="center" min-width="70px" prop="costPrice" label="成本价"></el-table-column>
      <el-table-column align="center" min-width="70px" prop="retailPrice" label="零售价"></el-table-column>
      <el-table-column align="center" min-width="70px" prop="profitRate" label="毛利率">
        <template slot-scope="scope">
          {{ scope.row.profitRate }}
        </template>
      </el-table-column>
      <el-table-column align="center" min-width="120px" prop="minPrice" label="起送价"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="channelPrice" label="商品原价"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="activityPrice" label="商品特价"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="salesRank" label="销售排名"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="monthSaled" label="月售"></el-table-column>
      <el-table-column align="center" min-width="150px" prop="competeOriginPrice" label="竞对原价最低价"></el-table-column>
      <el-table-column align="center" min-width="150px" prop="competeActivityPrice" label="竞对特价最低价"></el-table-column>
      <el-table-column align="center" min-width="110px" prop="competeMaxSales" label="竞对最高销量"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="cellularSales" label="蜂窝总销量"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="limit" label="限购规则"></el-table-column>
      <el-table-column align="center" min-width="100px" label="商品编码">
        <template slot-scope="scope">
          <div style="cursor:pointer;text-decoration:underline" @click="onOpenGoodsDetailModal(scope.row)">
            {{ scope.row.goodsCode }}
          </div>
        </template>
      </el-table-column>
      <el-table-column align="center" min-width="120px" prop="channelCode" label="渠道编码"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="cellularName" label="所属蜂窝"></el-table-column>
    </el-table>
    <div :class="$style.tablePagination">
      <el-pagination
        @size-change="onPageSizeChange"
        @current-change="onPageNumChange"
        :current-page="currentPage"
        :page-sizes="[10, 20, 50, 100, 200]"
        :page-size="pageSize"
        layout="total, prev, pager, next, sizes"
        :total="total"
      />
    </div>
  </div>
</template>
<style lang="scss" module>
@import './index.module.scss';
</style>

<script>
import Index from './index';
export default Index;
</script>
